﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using XCommunity.Metas;

namespace XCommunity.Frames
{

  /// <summary>
  /// 代表一个话题的元数据
  /// </summary>
  public class TopicMeta
  {

    /// <summary>
    /// 元数据是否已经被保存
    /// </summary>
    public bool Saved
    {
      get;
      internal set;
    }


    public TopicMeta()
    {
      Saved = false;
    }



    private int _id;

    /// <summary>
    /// 话题ID
    /// </summary>
    public int TopicId
    {
      get
      {
        if ( !Saved )
          throw new InvalidOperationException();
        return _id;
      }

      internal set
      {
        _id = value;
      }
    }

    
    /// <summary>
    /// 话题唯一标识
    /// </summary>
    public Guid Guid
    {
      get;
      internal set;
    }

    /// <summary>
    /// 话题标题
    /// </summary>
    public string Title
    {
      get;
      set;
    }

    /// <summary>
    /// 话题发起人
    /// </summary>
    public string Launcher
    {
      get;
      set;
    }

    /// <summary>
    /// 话题被发起的时间
    /// </summary>
    public DateTime LaunchDate
    {
      get;
      internal set;
    }

  }
}
